package com.njym.java.security.admin.mapper;

import com.njym.java.security.admin.entity.FamilyUser;
import com.njym.java.security.admin.entity.FamilyUserVo;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

/**
 * 
 * 
 * @author lijie
 * @email 717057076@qq.com
 * @date 2019-11-06 09:41:28
 */

public interface FamilyUserMapper extends Mapper<FamilyUser> {

    List<Map> statUser();

    long countUser();

    /**
     * 查询家庭主
     * @return
     */
    List<FamilyUser> queryFamilyZhu();

    /**
     * 查询每天张晋间接会员
     * @param start
     * @param end
     * @return
     */
    List<FamilyUser> queryIndirect(@Param("start") String start, @Param("end") String end);

    /**
     * 添加
     * @param familyUser
     * @return
     */
    int insertFamilyUser(FamilyUser familyUser);

    List<FamilyUserVo> getListAndPercent(@Param("teacherId") Integer teacherId, @Param("name") String name, @Param("mobile") String mobile);

    int selectCounts(@Param("teacherId") Integer teacherId, @Param("name") String name, @Param("mobile") String mobile);

    List<FamilyUser> query365(@Param("start") String start, @Param("end") String end);

    List<FamilyUserVo> queryDaiLiRegister(@Param("start") String start, @Param("end") String end);

    List<FamilyUser> queryNoRegister(@Param("start") String start, @Param("end") String end);

    Integer getDailiCounts();

    List<FamilyUser> getList(@Param("name") String name, @Param("mobile") String mobile,@Param("createdTime") String createdTime);

    /**
     * 普通用户推广的数据
     * @param name
     * @param mobile
     * @return
     */
    List<FamilyUserVo> getZhiJieCount(@Param("name") String name, @Param("mobile") String mobile);

}
